<!DOCTYPE html>
<html>
<head>
<div th:replace="common/common_resource :: common_css"></div>
<title th:text="${application.shop_name} +' | 买满立减模板维护'"></title>
</head>
<body class="hold-transition skin-blue sidebar-mini" >
	<div class="wrapper">
		<div th:replace="common/common_h5 :: loginAndLogout"></div>
		<div th:replace="common/common_h5 :: upload_image"></div>
		<div th:replace="common/common_h5 :: left_menu"></div>
		<div class="content-wrapper">
			<section class="content">
				<div class="row">
					<div class="col-xs-12">
						<div class="box">
							<div class="box-header">
								<div class="row">
									<div class="col-xs-4">
										<span>
											<button type="button" name="cleanAll" id="add_dep" class="btn  btn-warning " style="margin-bottom: 10px;" data-toggle="modal" data-target="#buyfulltemp_add_and_update">
													<i class="fa fa-plus">添加买满立减模板</i>
											</button>
										</span>
										<div class="modal fade " id="buyfulltemp_add_and_update" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<div class="modal-dialog ">
												<div class="modal-content">
													<div class="modal-header bg-blue">
														<button type="button" name="cleanAll" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
														<h4 class="modal-title" id="myModalLabel">添加/修改买满立减模板</h4>
													</div>
													<div class="modal-body" id="changeModalbody">
														<form role="form" id="formBuyfullTemp" th:action="${#httpServletRequest.getContextPath()}+'/TblWxBuyfullTemplate/insertAndUpdate'"method="post">
															<div class="box-body">
															<input type="hidden" name="menuUuid" th:value="${menuUuid!=null}?${menuUuid}:'420'"/>
																<div class="form-group">
																	<label for="buyfullTempName">买满立减模板名称<font color="red">&nbsp;&nbsp;*</font></label>
																	<input type="hidden" name="buyfullTempId" id="buyfullTempId" th:value="${dataBean!=null? dataBean.buyfullTempId:''}" />
																	<input type="text" name="buyfullTempName" class="form-control" id="buyfullTempName" th:value="${dataBean!=null? dataBean.buyfullTempName:''}" placeholder="买满立减模板名称" />
																</div>
																<div class="form-group">
																	<label for="buyfullTempDesc">买满立减模板介绍<font color="red">&nbsp;&nbsp;*</font></label>
																	<input type="text" class="form-control" name="buyfullTempDesc" id="buyfullTempDesc"  th:value="${dataBean!=null? dataBean.buyfullTempDesc:''}" placeholder="买满立减模板介绍" />
																</div>
																<div class="form-group" id="startAndEnd">
																	<label for="buyfullTempEndtimeView">打折时间<font color="red">&nbsp;&nbsp;*</font></label>
																	<div class="row">
																		<div class="col-xs-6 text-left">
																			<div class="input-group date">
																			<div class="input-group-addon">
																				<i class="fa fa-calendar"></i>
																			</div>
																			<input class="form-control pull-right datepicker" th:value="${dataBean!=null? dataBean.buyfullTempStarttimeView:''}"  id="buyfullTempStarttimeView" name="buyfullTempStarttimeView" type="text" placeholder="开始时间">
																		</div>
																		</div>
																		<div class="col-xs-6 text-left">
																			<div class="input-group date">
																				<div class="input-group-addon">
																					<i class="fa fa-calendar"></i>
																				</div>
																				<input class="form-control pull-right datepicker" th:value="${dataBean!=null? dataBean.buyfullTempEndtimeView:''}"  id="buyfullTempEndtimeView" name="buyfullTempEndtimeView" type="text" placeholder="结束时间">
																			</div>
																		</div>
																	</div>
																</div>
																<h5 class="page-header"></h5>
																<label for="buyfullAmt">满（XXX）立减（XXX）<font color="red">&nbsp;&nbsp;*</font></label>
																<div class="form-group" id="addHtml">
																	<div class="row" >
																		<div class="col-xs-5 text-left">
																			<input type="NUMBER"  max="9999999999999" th:value="${dataBean!=null && dataBean.buyfullAmt!=null && dataBean.buyfullAmt.length>0}?${dataBean.buyfullAmt[0]}:''" class="form-control" name="buyfullAmt" id="buyfullAmt"  placeholder="满多少" />
																		</div>
																		<div class="col-xs-5 text-left">
																			<input type="NUMBER" class="form-control" max="9999999999999" th:value="${dataBean!=null && dataBean.buyfullSubtAmt!=null && dataBean.buyfullSubtAmt.length>0}?${dataBean.buyfullSubtAmt[0]}:''"   name="buyfullSubtAmt" id="buyfullSubtAmt"  placeholder="立减多少" />
																		</div>
																	</div>
																	<br>
																	<div th:if="${dataBean!=null && dataBean.buyfullAmt!=null && dataBean.buyfullSubtAmt!=null && dataBean.buyfullAmt.length==dataBean.buyfullSubtAmt.length}" th:each="buyfullAmt,buyfullAmtStat : ${dataBean!=null}?${dataBean.buyfullAmt}:''" >
																		<div class="row" th:if="${buyfullAmtStat!=null && buyfullAmtStat.index!=0}">
																			<div class="col-xs-5 text-left"><input type="NUMBER" class="form-control" th:value="${dataBean.buyfullAmt[buyfullAmtStat.index]}" name="buyfullAmt" id="buyfullAmt"  placeholder="满多少" /></div>
																			<div class="col-xs-5 text-left"><input type="NUMBER" class="form-control" th:value="${dataBean.buyfullSubtAmt[buyfullAmtStat.index]}" name="buyfullSubtAmt" id="buyfullSubtAmt"  placeholder="立减多少" /></div>
																			<div class="col-xs-2 text-left"><button type="button" class="btn btn-danger deleteRow">删除</button></div>
																		</div>
																		<br th:if="${buyfullAmtStat!=null && buyfullAmtStat.index!=0}"/>
																	</div>
																</div>
																<div class="row">
																	<div class="col-xs-6 text-center"></div>
																	<div class="col-xs-6 text-right">
																		<a class="btn btn-success" id="addbuyfullAmt" href="javascript:void(0);">添加更多</a>
																	</div>
																</div>
															</div>
															<div class="modal-footer">
																<div class="row">
																	<div class="col-xs-6 text-center">
																		<button type="reset" class="btn btn-warning" name="cleanAll">清&nbsp;&nbsp;&nbsp;&nbsp;除</button>
																	</div>
																	<div class="col-xs-6 text-center">
																		<button type="submit" class="btn btn-primary">提&nbsp;&nbsp;&nbsp;&nbsp;交</button>
																	</div>
																</div>
															</div>
														</form>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="col-xs-4">
										<h3 class="box-title">买满立减模板数据列表</h3>
									</div>
									<div class="col-xs-4"></div>
								</div>
							</div>
							<div class="box-body table-responsive">
								<table id="example2" class="table table-bordered table-striped ">
									<thead>
										<tr class="bg-green ">
											<th>序号</th>
											<th>模板名称</th>
											<th>模板介绍</th>
											<th>优惠时间段</th>
											<th>详情</th>
											<th>是否过期</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
									<tr th:class="${buyfullTempStat.index % 2 ==0}? '' : 'bg-gray'" th:each="buyfullTemp,buyfullTempStat : ${buyfullTempList}">
											<td th:text="${buyfullTempStat.index+1}"></td>
											<td th:text="${buyfullTemp.buyfullTempName}"></td>
											<td th:text="${buyfullTemp.buyfullTempDesc}"></td>
											<td th:text="${buyfullTemp.buyfullTempStarttimeView}+'-'+${buyfullTemp.buyfullTempEndtimeView}"></td>
											<td><code th:if="${buyfullTemp !=null && buyfullTemp.buyFullList!=null}" th:each="buyfull,iterStat:${buyfullTemp!=null}? ${buyfullTemp.buyFullList}:''" th:text="'满'+${buyfull.buyfullAmt}+'立减'+${buyfull.buyfullSubtAmt}">
						                		</code>&nbsp;&nbsp;
						                	</td>
											<td><i class="fa fa-circle text-success" th:if="${buyfullTemp.isExceed==1}">未过期</i>
												<i class="fa fa-circle text-danger" th:if="${buyfullTemp.isExceed==-1}">已过期</i>
											</td>
											<td>
												&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="javascript:void(0);" th:id="${buyfullTemp!=null}?${buyfullTemp.buyfullTempId}:''" name="show" class="fa fa-file btn btn-primary">详情</a>&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="javascript:void(0);" th:id="${buyfullTemp!=null}?${buyfullTemp.buyfullTempId}:''"  data-toggle="tooltip"  data-placement="top" data-original-title="删除后将无法恢复"  class="fa fa-trash btn btn-primary example5-3-2" >废除</a>
											</td>
									</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<div th:replace="common/common_h5 :: down_foot"></div>
		<div th:replace="common/common_h5 :: down_sidebar"></div>
		<div th:replace="common/common_h5 :: error_message"></div>
		<div class="control-sidebar-bg"></div>
		<div th:replace="common/common_resource :: common_js"></div>
		<script th:src="@{/admin_js/basics/process/buyfulltemp_list.js}"></script>
</body>
</html>
